package com.chinazyjr.framework.common.enums;

/**
 * @author liyuxuan
 * @Description
 * @Email liyuxuan@chinazyjr.com
 * Created on 2017/12/26 14:28
 * Copyright (c) 2017 All Rights Reserved.
 */
public enum BankResponseCodeEnum {
    SUCCESS("0", "成功"),
    SYS_EXCEPTION("1", "系统异常"),
    SYS_ERROR("100001", "系统错误"),
    JSON_PARAMETER_FORMAT_ERROR("100002", "json参数格式错误"),
    SIGNATURE_VERIFICATION_FAILURE("100003", "签名验证失败"),
    PLATFROM_CODE_NOT_EXIST("100004", "平台编号不存在"),
    PLATFROM_STATUS_EXCEPTION("100005", "平台状态异常"),
    BUSINESS_IS_NOT_OPEN("100006", "业务未开通"),
    ORDER_NOT_NOT_EXIST("100007", "交易订单不存在"),
    FAILURE_OF_BUSINESS_ACCEPTANCE("100008", "业务受理失败"),
    RECHARGE_FAILURE("100009", "充值失败");

    private String value;
    private String name;

    BankResponseCodeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(String value) {
        for (BankResponseCodeEnum brc : BankResponseCodeEnum.values()) {
            if (brc.getValue().equals(value))
                return brc.getName();
        }
        return null;
    }
}
